<?php
namespace app\index\controller;
use think\Controller;
use think\Db;

class Sanji extends Controller
{
	public function index()
	{
		$sheng=Db::table('tp_region')
			->where([['level','=',1],['parent_id','=',0]])->select();
		return $this->fetch('index',['res'=>$sheng]);
	}
	public function gets($id)
	{
		$sf=Db::table('tp_region')
			->where([['level','=',2],['parent_id','=',$id]])->select();
		return json($sf);
	}
	public function getcity()
	{
		$id=input('param.id');
		$city=Db::table('tp_region')
			->where([['level','=',3],['parent_id','=',$id]])->select();
		return json($city);	
	}
}
?>